home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / SICL / data1.cab / sicl32 / c / sicl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-02  |  41.3 KB  |  1,286 lines

  1. /* $Header: /sicl/src/m_sicl/sicl.h 1.245 2000/10/16 21:28:27 pstone Exp $ */
  2. /* Copyright 1992-2000 Agilent Technologies Inc.  All Rights Reserved. */
  3. /*
  4.  * Agilent Standard Instrument Control Library
  5.  *
  6.  * This file conforms to the Agilent SICL Spec as specified in I_SICL_REVISION.
  7.  *
  8.  * #define's used (can be #defined by user):
  9.  *   STD_SICL - Disallows non-standard constructs
  10.  *
  11.  * #define's used (not typically set by user)
  12.  *   SICL_H - Prevents multiple inclusion
  13.  *   SICL_NOPROTO - Don't include function prototypes
  14.  *   
  15.  */
  16.  
  17. /*
  18.  * Make sure this file is only included once
  19.  */
  20. #if !defined(SICL_H)
  21. #define SICL_H
  22.  
  23. /*
  24.  * determine which OS we are compiling on
  25.  * Don't use #elif here, some bug in std cpp on hpux. DTS ISLxx14032
  26.  */
  27. #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
  28. #define _SICL_WIN32
  29. #if !defined(__BORLANDC__)
  30. #define _SICL_VXI_D64
  31. #endif
  32. #else
  33. #if defined(__MSDOS__)||defined(MSDOS)||defined(_MSDOS)||defined(_WINDOWS)
  34. #define _MS_DOS_WIN
  35. #endif
  36. #endif
  37.  
  38. #if defined(__hpux)
  39. #define _SICL_HPUX
  40. #if defined(__cplusplus)
  41. #define volatile
  42. #endif
  43. #endif
  44. #if defined(__Lynx__) && defined(__68k__)
  45. #define _SICL_LYNX_BE
  46. #endif
  47. #if defined(__Lynx__) && defined(__x86__)
  48. #define _SICL_LYNX_LE
  49. #define _SICL_LYNX_FA            /* This is for Lynx on Fantasia */
  50. #endif
  51. #if defined(linux) && defined(i386)
  52. #define _SICL_LINUX_LE
  53. #endif
  54.  
  55. /*
  56.  * define out Windows specific keywords if not compiling for Windows
  57.  */
  58. #if !defined(_MS_DOS_WIN)
  59. #define _near
  60. #define _far
  61. #define _huge
  62. #define _pascal
  63. #define _export
  64. #endif
  65.  
  66.  
  67. /*
  68.  * define SICLAPI, SICLAPIV, and SICLCALLBACK appropriately
  69.  */
  70. #if defined(_SICL_WIN32)
  71. #define SICLAPI __cdecl
  72. #define SICLAPIV __cdecl
  73. #define SICLCALLBACK __cdecl
  74. #else
  75. #if defined(_MS_DOS_WIN)
  76. #define SICLCALLBACK _far _pascal _export
  77. #define SICLAPI _far _pascal
  78. #define SICLAPIV _far __cdecl
  79. #else
  80. #define SICLAPI
  81. #define SICLAPIV
  82. #define SICLCALLBACK
  83. #endif
  84. #endif
  85.  
  86.  
  87. /*
  88.  * Support levels:
  89.  */
  90. #define I_SICL_REVISION 40      /* Agilent SICL Revision 4.0 */
  91. #define I_SICL_LEVEL 3  /* Support Level */
  92. #define I_SICL_FMTIO    /* Support Formatted I/O */
  93. #define I_SICL_GPIB     /* Support GP-IB */
  94. #define I_SICL_VXI      /* Support VXI */
  95. #define I_SICL_LAN      /* Support LAN */
  96. #define I_SICL_RS232    /* Support RS-232 */
  97. #define I_SICL_GPIO     /* Support GPIO */
  98. #define I_SICL_MSIB     /* Support MSIB */
  99.  
  100. /*
  101.  * The following is needed for functions that require va_list in the
  102.  * prototypes.
  103.  */
  104. #if defined(I_SICL_FMTIO)
  105. #include <stdarg.h>
  106. #endif
  107.  
  108. /*
  109.  * Definition of INST:
  110.  */
  111. typedef int INST;
  112.  
  113. /*
  114.  * session types
  115.  */
  116. #define I_SESS_INTF  1
  117. #define I_SESS_DEV   2
  118. #define I_SESS_CMDR  3
  119.  
  120. /*
  121.  * interface types
  122.  */
  123. #define  I_INTF_NONE   0
  124. #define I_INTF_GPIB    1
  125. #define I_INTF_VXI     2
  126. #define I_INTF_RS232   3
  127. #define I_INTF_GPIO    4
  128. /* 5 is reserved -- don't use */
  129. #define I_INTF_USRDEF  6
  130. /* 7 is reserved -- don't use */
  131. #define I_INTF_MSIB    8
  132. #define I_INTF_LAN     9
  133. #define I_INTF_IICP   10
  134. #define I_INTF_SOCKET 11
  135. /*
  136.  * iread termination conditions
  137.  */
  138. #define I_TERM_MAXCNT      1
  139. #define I_TERM_CHR         2
  140. #define I_TERM_END         4
  141. #define I_TERM_NON_BLOCKED 8
  142.  
  143. /*
  144.  * ixtrig 'which' values.  Note:  different interface types may have
  145.  * overlapping constants.  However, don't overlap them until it is required.
  146.  */
  147. #define I_TRIG_STD         0x00000001L
  148. #define I_TRIG_ALL         0xffffffffL
  149. #define I_TRIG_TTL0        0x00001000L
  150. #define I_TRIG_TTL1        0x00002000L
  151. #define I_TRIG_TTL2        0x00004000L
  152. #define I_TRIG_TTL3        0x00008000L
  153. #define I_TRIG_TTL4        0x00010000L
  154. #define I_TRIG_TTL5        0x00020000L
  155. #define I_TRIG_TTL6        0x00040000L
  156. #define I_TRIG_TTL7        0x00080000L
  157. #define I_TRIG_ECL0        0x00100000L
  158. #define I_TRIG_ECL1        0x00200000L
  159. #define I_TRIG_ECL2        0x00400000L
  160. #define I_TRIG_ECL3        0x00800000L
  161. #define I_TRIG_EXT0        0x01000000L
  162. #define I_TRIG_EXT1        0x02000000L
  163. #define I_TRIG_EXT2        0x04000000L
  164. #define I_TRIG_EXT3        0x08000000L
  165. #define I_TRIG_CLK0        0x10000000L
  166. #define I_TRIG_CLK1        0x20000000L
  167. #define I_TRIG_CLK2        0x40000000L
  168. #define I_TRIG_CLK10       0x80000000L
  169. #define I_TRIG_CLK100      0x00000800L
  170. #define I_TRIG_SERIAL_DTR  0x00000400L
  171. #define I_TRIG_SERIAL_RTS  0x00000200L
  172. #define I_TRIG_GPIO_CTL0   0x00000100L
  173. #define I_TRIG_GPIO_CTL1   0x00000080L
  174.  
  175. /*
  176.  * ihint values
  177.  */
  178. #define  I_HINT_DONTCARE   0
  179. #define  I_HINT_USEDMA     1
  180. #define  I_HINT_USEPOLL    2
  181. #define  I_HINT_USEINTR    3
  182. #define  I_HINT_SYSTEM     4
  183. #define  I_HINT_IO         5
  184.  
  185. /*
  186.  * isetintr values
  187.  */
  188. /* 1-15 are interface independant */
  189. #define I_INTR_OFF        0 /* Turn off interrupts */
  190. #define I_INTR_INTFACT    1
  191. #define I_INTR_INTFDEACT  2
  192. #define I_INTR_TRIG       3
  193. #define I_INTR_STB        4
  194. #define I_INTR_DEVCLR     5
  195.  
  196. /* 16-31 are interface specific */
  197. /* VXI Interrupts */
  198. #define I_INTR_VXI_SIGNAL        16
  199. #define I_INTR_VXI_SYSRESET      17
  200. #define I_INTR_VXI_VME           18
  201. #define I_INTR_VXI_LLOCK         19
  202. #define I_INTR_VXI_UKNSIG        20
  203. #define I_INTR_VXI_VMESYSFAIL    21
  204. #define I_INTR_VME_IRQ1          22
  205. #define I_INTR_VME_IRQ2          23
  206. #define I_INTR_VME_IRQ3          24
  207. #define I_INTR_VME_IRQ4          25
  208. #define I_INTR_VME_IRQ5          26
  209. #define I_INTR_VME_IRQ6          27
  210. #define I_INTR_VME_IRQ7          28
  211. #define I_INTR_ANY_SIG           29
  212. /* GP-IB Interrupts */
  213. #define I_INTR_GPIB_IFC          16
  214. #define I_INTR_GPIB_PPOLLCONFIG  17
  215. #define I_INTR_GPIB_REMLOC       18
  216. #define I_INTR_GPIB_GET          20
  217. #define I_INTR_GPIB_TLAC         21
  218. /* RS-232 Interrupts */
  219. #define I_INTR_SERIAL_DAV        16
  220. #define I_INTR_SERIAL_MSL        17
  221. #define I_INTR_SERIAL_BREAK      18
  222. #define I_INTR_SERIAL_ERROR      19
  223. #define I_INTR_SERIAL_TEMT       20
  224. #define I_INTR_SERIAL_MCL        21
  225. /* GP-IO Interrupts */
  226. #define I_INTR_GPIO_EIR          16
  227. #define I_INTR_GPIO_RDY          17
  228. /* MSIB Interrupts */
  229. #define I_INTR_MSIB_END_RECEIVED 22
  230. #define I_INTR_MSIB_LINK_BROKEN  23
  231. /* 32 maximum isetintr values */
  232. #define I_INTR_MAX               32
  233.  
  234. /*
  235.  * Swap Constants
  236.  *
  237.  * NOTE:  The byte ordering constants are more than OS dependant,
  238.  * but also dependant on the computer it is implemented on.  (i.e.
  239.  * UNIX has been implemented on INTEL machines and Motorola machines.)
  240.  * If your machine is not identified here, you must be porting our
  241.  * code.  You need to create a constant that uniquely identifies
  242.  * your OS and machine and define the correct ordering macro.  For
  243.  * long term support, submit a DTS, with explicite instruction
  244.  * describing the enhancement for you system.
  245.  */
  246. #if defined(_MS_DOS_WIN) || defined(_SICL_WIN32) || defined(_SICL_LYNX_LE) || defined (_SICL_LINUX_LE)
  247.    /* Little Endian */
  248. #define I_ORDER_LE
  249. #undef  I_ORDER_BE
  250. #endif
  251.  
  252. #if defined(_SICL_HPUX) || defined(_SICL_LYNX_BE)
  253.    /* Big Endian */
  254. #undef  I_ORDER_LE
  255. #define I_ORDER_BE
  256. #endif
  257.  
  258. /* ivxibusstatus values */
  259. #define I_VXI_BUS_TRIGGER         0
  260. #define I_VXI_BUS_LADDR           1
  261. #define I_VXI_BUS_SERVANT_AREA    2
  262. #define I_VXI_BUS_NORMOP          3
  263. #define I_VXI_BUS_CMDR_LADDR      4
  264. #define I_VXI_BUS_MAN_ID          5
  265. #define I_VXI_BUS_MODEL_ID        6
  266. #define I_VXI_BUS_PROTOCOL        7
  267. #define I_VXI_BUS_XPROT           8
  268. #define I_VXI_BUS_SHM_SIZE        9
  269. #define I_VXI_BUS_SHM_ADDR_SPACE 10
  270. #define I_VXI_BUS_SHM_PAGE       11
  271. #define I_VXI_BUS_VXIMXI         12
  272. #define I_VXI_BUS_TRIGSUPP       13
  273.  
  274. /* igpibbusstatus values */
  275. #define I_GPIB_BUS_REM         1
  276. #define I_GPIB_BUS_SRQ         2
  277. #define I_GPIB_BUS_NDAC        3
  278. #define I_GPIB_BUS_SYSCTLR     4
  279. #define I_GPIB_BUS_ACTCTLR     5
  280. #define I_GPIB_BUS_TALKER      6
  281. #define I_GPIB_BUS_LISTENER    7
  282. #define I_GPIB_BUS_ADDR        8
  283. #define I_GPIB_BUS_LINES       9
  284.  
  285. #define I_GPIB_T1DELAY_MIN   350
  286. #define I_GPIB_T1DELAY_MAX  2400
  287.    
  288. /* values for igpioctrl and igpiostat */
  289. #define  I_GPIO_AUX         1
  290. #define  I_GPIO_CTRL        2
  291. #define  I_GPIO_DATA        3
  292. #define  I_GPIO_INFO        4
  293. #define  I_GPIO_SET_PCTL    5
  294. #define  I_GPIO_STAT        6
  295. #define  I_GPIO_READ_EOI    7
  296. #define  I_GPIO_TEST_ONLY   8
  297. #define  I_GPIO_POLARITY    9
  298. #define  I_GPIO_READ_CLK   10
  299. #define  I_GPIO_PCTL_DELAY 11
  300.  
  301. /* 
  302.  * Note that I_GPIO_CHK_PSTS and I_GPIO_AUTO_HDSK are safely overloaded
  303.  * an igpioctrl request value and a bit mask for I_GPIO_INFO.  This is
  304.  * OK because their values (16 and 32) do not conflict with any other
  305.  * defined igpioctrl values.
  306.  */
  307.  
  308. #define  I_GPIO_CTRL_CTL0  0x01
  309. #define  I_GPIO_CTRL_CTL1  0x02
  310.  
  311. #define  I_GPIO_STAT_STI0  0x01
  312. #define  I_GPIO_STAT_STI1  0x02
  313. #define  I_GPIO_EIR        0x04
  314. #define  I_GPIO_PSTS       0x08
  315. #define  I_GPIO_CHK_PSTS   0x10
  316. #define  I_GPIO_AUTO_HDSK  0x20
  317. #define  I_GPIO_ENH_MODE   0x40
  318. #define  I_GPIO_READY      0x80
  319. #define  I_GPIO_EOI_NONE   0x10000
  320.  
  321. /* RS-232 values */
  322. /* STATUS AND CONTROL CONST  */
  323. #define I_SERIAL_BAUD          1
  324. #define I_SERIAL_PARITY        2
  325. #define I_SERIAL_STOP          3
  326. #define I_SERIAL_WIDTH         4
  327. #define I_SERIAL_FLOW_CTRL     5
  328. #define I_SERIAL_MSL           6
  329. #define I_SERIAL_STAT          7
  330. #define I_SERIAL_RESET         9
  331. #define I_SERIAL_READ_EOI     10
  332. #define I_SERIAL_WRITE_EOI    11
  333. #define I_SERIAL_DUPLEX       12
  334. #define I_SERIAL_READ_BUFSZ   13
  335. #define I_SERIAL_READ_DAV     14
  336. #define I_SERIAL_IN_DISCARD   15
  337. #define I_SERIAL_OUT_DISCARD  16
  338. #define I_SERIAL_XON_CHAR     17
  339. #define I_SERIAL_XOFF_CHAR    18
  340. #define I_SERIAL_REPLACE_CHAR 19
  341.  
  342. /* SERIAL duplex modes */
  343. #define I_SERIAL_DUPLEX_HALF  0x0001
  344. #define I_SERIAL_DUPLEX_FULL  0x0002
  345.  
  346. /* SERIAL UART STATUS */
  347. #define I_SERIAL_DAV          0x0001
  348. #define I_SERIAL_OVERFLOW     0x0002
  349. #define I_SERIAL_PARERR       0x0004
  350. #define I_SERIAL_FRAMING      0x0008
  351. #define I_SERIAL_BREAK        0x0010
  352. #define I_SERIAL_TEMT         0x0020
  353.  
  354. /* FLOW CONTROL CONST  */
  355. #define I_SERIAL_FLOW_NONE    0
  356. #define I_SERIAL_FLOW_XON     1
  357. #define I_SERIAL_FLOW_RTS_CTS 2
  358. #define I_SERIAL_FLOW_DTR_DSR 3
  359.  
  360. /* SERIAL MODEM STATUS LINES  */
  361. #define I_SERIAL_DCD       0x0001
  362. #define I_SERIAL_DSR       0x0002
  363. #define I_SERIAL_CTS       0x0004
  364. #define I_SERIAL_RI        0x0008
  365. #define I_SERIAL_D_DCD     0x0010
  366. #define I_SERIAL_D_DSR     0x0020
  367. #define I_SERIAL_D_CTS     0x0040
  368. #define I_SERIAL_TERI      0x0080
  369.  
  370. /* SERIAL MODEM CONTROL LINES */
  371. #define I_SERIAL_RTS       0x1000
  372. #define I_SERIAL_DTR       0x2000
  373.  
  374. /* SERIAL PARITY VALUES  */
  375. #define I_SERIAL_PAR_NONE     0
  376. #define I_SERIAL_PAR_EVEN     1
  377. #define I_SERIAL_PAR_ODD      2
  378. #define I_SERIAL_PAR_MARK     3
  379. #define I_SERIAL_PAR_SPACE    4
  380. #define I_SERIAL_PAR_IGNORE   5
  381.  
  382. /* SERIAL STOP-BIT VALUES */
  383. #define I_SERIAL_STOP_1       1
  384. #define I_SERIAL_STOP_2       2
  385.  
  386. /* SERIAL CHARACTER WIDTH  */
  387. #define I_SERIAL_CHAR_5       5
  388. #define I_SERIAL_CHAR_6       6
  389. #define I_SERIAL_CHAR_7       7
  390. #define I_SERIAL_CHAR_8       8
  391.  
  392. /* EOI support (used with the I_SERIAL_*_EOI command) */
  393. #define I_SERIAL_EOI_CHR      0x100
  394. #define I_SERIAL_EOI_NONE     0x200
  395. #define I_SERIAL_EOI_BIT8     0x400
  396.  
  397. /*
  398.  * MSIB error types (for imsibseterror)
  399.  */
  400. #define I_MSIB_PERMANENTERR      0
  401. #define I_MSIB_TRANSIENTERR      1
  402.  
  403. /*
  404.  * MSIB commands (for imsibcmd)
  405.  */
  406. #define I_MSIB_CMD_NULL                 0x0000
  407. #define I_MSIB_CMD_END                  0x0001
  408. #define I_MSIB_CMD_SEND_CAPABILITY      0x0002
  409. #define I_MSIB_CMD_RETURN_TO_LOCAL      0x0006
  410. #define I_MSIB_CMD_LOCK_LINK            0x0007
  411. #define I_MSIB_CMD_UNLOCK_LINK          0x0008
  412. #define I_MSIB_CMD_LIGHT_ACTIVE         0x0009
  413. #define I_MSIB_CMD_UNLIGHT_ACTIVE       0x000A
  414. #define I_MSIB_CMD_ERROR_OCCURRED       0x000B
  415. #define I_MSIB_CMD_ERRORS_CLEARED       0x000C
  416. #define I_MSIB_CMD_SEND_STATUS          0x0010
  417. #define I_MSIB_CMD_SEND_ERRORS          0x0011
  418. #define I_MSIB_CMD_SEND_MODULE_ID       0x0012
  419. #define I_MSIB_CMD_SEND_MANUFACTURER    0x0013
  420. #define I_MSIB_CMD_SEND_TIME            0x0014
  421. #define I_MSIB_CMD_LINK_REMOTE          0x0015
  422. #define I_MSIB_CMD_LINK_LOCAL           0x0016
  423. #define I_MSIB_CMD_SEND_MODEL_NUMBER    0x0017
  424. #define I_MSIB_CMD_SEND_SERIAL_NUMBER   0x0018
  425. #define I_MSIB_CMD_SEND_FIRMWARE_REV    0x0019
  426. #define I_MSIB_CMD_STATUS               0x0600
  427. #define I_MSIB_CMD_SET_IEEE_ADDRESS     0x0700
  428.  
  429. /*
  430.  * imap 'mapspace' values
  431.  */
  432. #define I_MAP_A16     0x0000
  433. #define I_MAP_A24     0x0001
  434. #define I_MAP_A32     0x0002
  435. #define I_MAP_VXIDEV  0x0003
  436. #define I_MAP_EXTEND  0x0004
  437. #define I_MAP_INTFREG 0x0005
  438. #define I_MAP_SHARED  0x0006
  439. #define I_MAP_AM      0x8000
  440. /*
  441.  *  For E1489 MXI
  442.  */
  443. #define I_MAP_A16_L             0x0007
  444. #define I_MAP_A16_D32           I_MAP_A16_L  
  445. #define I_MAP_A24_L             0x0008
  446. #define I_MAP_A24_D32           I_MAP_A24_L  
  447. #define I_MAP_A24_BLK           0x0009
  448. #define I_MAP_A24_BLK_L         0x000a
  449. #define I_MAP_A32_L             0x000b
  450. #define I_MAP_A32_D32           I_MAP_A32_L  
  451. #define I_MAP_A32_BLK           0x000c
  452. #define I_MAP_A32_BLK_L         0x000d
  453. #define I_MAP_A16_SM            0x000e  /* MXI supervisory mode access */
  454. #define I_MAP_A24_SM            0x000f  /* MXI supervisory mode access */
  455. #define I_MAP_A32_SM            0x0010  /* MXI supervisory mode access */
  456. #define I_MAP_A16_SM_L          0x0011  /* MXI SM D32 */
  457. #define I_MAP_A16_SM_D32        I_MAP_A16_SM_L
  458. #define I_MAP_A24_SM_L          0x0012  /* MXI SM D32 */
  459. #define I_MAP_A24_SM_D32        I_MAP_A24_SM_L
  460. #define I_MAP_A32_SM_L          0x0013  /* MXI SM D32 */
  461. #define I_MAP_A32_SM_D32        I_MAP_A32_SM_L
  462.  
  463. /*
  464.  * Error Codes
  465.  */
  466. #define I_ERR_NOERROR        0
  467. #define I_ERR_SYNTAX         1
  468. #define I_ERR_SYMNAME        2
  469. #define I_ERR_BADADDR        3
  470. #define I_ERR_BADID          4
  471. #define I_ERR_PARAM          5
  472. #define I_ERR_NOCONN         6
  473. #define I_ERR_NOPERM         7
  474. #define I_ERR_NOTSUPP        8
  475. #define I_ERR_NORSRC         9
  476. #define I_ERR_NOINTF        10
  477. #define I_ERR_LOCKED        11
  478. #define I_ERR_NOLOCK        12
  479. #define I_ERR_BADFMT        13
  480. #define I_ERR_DATA          14
  481. #define I_ERR_TIMEOUT       15
  482. #define I_ERR_OVERFLOW      16
  483. #define I_ERR_IO            17
  484. #define I_ERR_OS            18
  485. #define I_ERR_BADMAP        19
  486. #define I_ERR_NODEV         20
  487. #define I_ERR_INVLADDR      21
  488. #define I_ERR_NOTIMPL       22
  489. #define I_ERR_ABORTED       23
  490. #define I_ERR_BADCONFIG     24
  491. #define  I_ERR_NOCMDR       25
  492. #define I_ERR_VERSION       26
  493. #define I_ERR_NESTEDIO      27
  494. #define I_ERR_BUSY          28
  495. #define I_ERR_BADREMADDR     32
  496. #if !defined(STD_SICL)
  497. #define I_ERR_CONNEXISTS    29
  498. #define I_ERR_BUSERR        30
  499. #define I_ERR_BUSERR_RETRY  31
  500. #define I_ERR_INTERNAL     128
  501. #define I_ERR_INTERRUPT    129
  502. #define I_ERR_UNKNOWNERR   130
  503. #endif
  504.  
  505. /*
  506.  * These are the buffer sizes for formatted I/O.  These will become
  507.  * a part of standard sicl.
  508.  * NOTE:  These numbers are tuned for HP-UX performance.
  509.  */
  510. #define I_READ_BUF_SZ       4096
  511. #define I_WRITE_BUF_SZ       128
  512.  
  513. #define I_BUF_READ          0x01
  514. #define I_BUF_WRITE         0x02
  515. #define I_BUF_DISCARD_READ  0x04
  516. #define I_BUF_DISCARD_WRITE 0x08
  517. #define I_BUF_WRITE_END     0x10
  518.  
  519.    /*
  520.     * LU info structure
  521.     * Only some of these fields are documented in SICL, others are
  522.     * documented in TULIP.
  523.     */
  524.    typedef struct lu_info {
  525.       long logical_unit;   /* Documented:  SICL/TULIP (hwconfig.cf) */
  526.       char symname[32];    /* Documented:  SICL/TULIP (hwconfig.cf) */
  527.       char cardname[32];   /* Documented:  SICL/TULIP (xxx_getentry) */
  528.       long filler;      /* Filler - Needed for backward compatability */
  529.       long intftype;    /* Documented:  SICL/TULIP (xxx_getentry) */
  530.       long location;    /* Documented:  TULIP      (hwconfig.cf) */
  531.       long busaddr;     /* Documented:  TULIP      (hwconfig.cf) */
  532.       char _far * hwarg[16];  /* Documented: TULIP    (hwconfig.cf) */
  533.       char visaname[32];        /* interface name used for VISA */   
  534.       long filler2[4];     /* Filler - Needed for future expansion  */
  535.    } lu_info;
  536.  
  537.    /*
  538.     * ivxirminfo structure
  539.     */
  540.    struct vxiinfo {
  541.       /* Device Identification */
  542.       short laddr;      /* Logical Address */
  543.       char name[16];    /* Symbolic Name */
  544.       char manuf_name[16]; /* Manufacturer Name */
  545.       char model_name[16]; /* Model Name */
  546.       unsigned short man_id;  /* Manufacturer ID */
  547.       unsigned short model;   /* Model Code */
  548.       unsigned short devclass;   /* Device Class */
  549.       
  550.       /* Self Test Status */
  551.       short selftest;      /* 1=PASSED, 0=FAILED */
  552.       
  553.       /* Location of Device */
  554.       short cage_num;      /* Cardcage Number */
  555.       short slot;    /* slot number, -1 is unknown, -2 is MXI */
  556.       
  557.       /* Device Information */
  558.       unsigned short protocol;   /* Value of protocol register */
  559.       unsigned short x_protocol;/* Results of Read Protocol WS command */
  560.       unsigned short servant_area;/* Value of servant area */
  561.       
  562.       /* Memory Information */
  563.       /* page size is 256 bytes for A24 and 64K bytes for A32 */
  564.       unsigned short addrspace;  /* 24=A24, 32=A32, 0=none */
  565.       unsigned short memsize; /* Amount of memory in pages */
  566.       unsigned short memstart;   /* Start of memory in pages */
  567.       
  568.       /* Misc. Information */
  569.       short slot0_laddr;   /* LADDR of slot 0 device, -1 if unknown */
  570.       short cmdr_laddr;    /* LADDR of commander, -1 if top level */
  571.       
  572.       /* Interrupt Information */
  573.       short int_handler[8];   /* List of interrupt handlers */
  574.       short interrupter[8];   /* List of interrupters */
  575.       
  576.       short fill[10];      /* Unused */
  577.    };
  578.  
  579.    /*
  580.     * vxiinfo structure values
  581.     */
  582. #define I_VXI_DEVCLASS_MEMORY    0x0000
  583. #define I_VXI_DEVCLASS_EXTENDED  0x4000
  584. #define I_VXI_DEVCLASS_MSGBASED  0x8000
  585. #define I_VXI_DEVCLASS_REGBASED  0xc000
  586.  
  587.  
  588.    typedef struct {
  589.       unsigned short     command;
  590.       unsigned long      mapHandle;
  591.       unsigned long      address;
  592.       unsigned long      parm1;
  593.       unsigned long      parm2;
  594.    } ivximacroelem;
  595.  
  596. #define I_VXI_MACRO_DELAY          (0x0001)
  597. #define I_VXI_MACRO_POLLSTAT16     (0x0002)
  598. #define I_VXI_MACRO_POKE8          (0x0003)
  599. #define I_VXI_MACRO_POKE16         (0x0004)
  600. #define I_VXI_MACRO_POKE32         (0x0005)
  601. #define I_VXI_MACRO_READMODWRITE16 (0x0006)
  602. #define I_VXI_MACRO_PEEK8          (0x0007)
  603. #define I_VXI_MACRO_PEEK16         (0x0008)
  604. #define I_VXI_MACRO_PEEK32         (0x0009)
  605. #define I_VXI_MACRO_SESSION        (0xfffe)
  606. #define I_VXI_MACRO_END            (0xffff)
  607.  
  608.    struct msibinfo {
  609.       char capability[127];   /* response to SEND CAPABILITY command */
  610.       char capability_length; /* capability may contain NULL bytes */
  611.       /* the rest are NULL-terminated strings */
  612.       char module_id[128]; /* response to SEND MODULE ID */
  613.       char mfg_id[128];    /* response to SEND MANUFACTURER ID */
  614.       char model_number[128]; /* response to SEND MODEL NUMBER */
  615.       char serial_number[128];   /* response to SEND SERIAL NUMBER */
  616.       char firmware_rev[128]; /* response to SEND FIRMWARE REVISION */
  617.    };
  618.  
  619. /* Non-Standard SICL Defines */
  620. #if !defined(STD_SICL)
  621.    /* Trace defines */
  622. #define  trace_off   0
  623. #define  trace_user  1
  624. #define  trace_inout 2
  625. #define  trace_action   3
  626. #define  trace_detail   4
  627. #define trace_xdetail   5
  628.    /* Configuration file defines */
  629.    /* Bus types (int bustype): */
  630. #define  I_BUS_INT   0  /* Internal Bus */
  631. #define  I_BUS_ISA   1  /* ISA Bus */
  632. #define  I_BUS_EISA  2  /* EISA Bus */
  633. #define  I_BUS_DIO   3  /* DIO I/II Bus */
  634. #define  I_BUS_VME   4  /* VME Bus */
  635. #define I_BUS_USRLND    5       /* Userland driver */
  636. #define  I_BUS_PCI   6  /* PCI Bus */
  637.    /* Bus types -- USE I_BUS_*, not these!!! (int bustype): */
  638. /*
  639.  * These are also defined in pilconfig.h.  If you change these
  640.  * you MUST also change the matching ones in pilconfig.h.
  641.  */
  642. #if !defined(CFG_BUS_INT)
  643. #define  CFG_BUS_INT I_BUS_INT
  644. #define  CFG_BUS_CORE   I_BUS_INT
  645. #define  CFG_BUS_ISA I_BUS_ISA
  646. #define  CFG_BUS_EISA   I_BUS_EISA
  647. #define  CFG_BUS_DIO I_BUS_DIO
  648. #define  CFG_BUS_VME I_BUS_VME
  649. #define CFG_BUS_USRLND  I_BUS_USRLND
  650. #define  CFG_BUS_PCI I_BUS_PCI
  651. /* Interface types -- USE I_INTF_*, not these!!! (int intftype): */
  652. #define  CFG_INTF_HPIB  I_INTF_GPIB /* GPIB Interface */
  653. #define  CFG_INTF_VXI   I_INTF_VXI  /* VXI Interface */
  654. #define  CFG_INTF_RS232 I_INTF_RS232   /* RS-232 Interface */
  655. #define  CFG_INTF_GPIO  I_INTF_GPIO /* GPIO Interface */
  656. #define  CFG_INTF_DIL   5     /* DIL Interface */
  657. #define CFG_INTF_USRDEF I_INTF_USRDEF   /* User-defined Interface type */
  658. #endif
  659. #endif
  660.  
  661.  
  662. #if ! defined(SICL_NOPROTO)
  663.  
  664. /* See if C++ or not */
  665. #if defined(__cplusplus)
  666.    extern "C" {
  667. #endif
  668.  
  669. #if defined(__STDC__) || defined(__cplusplus) || defined(_MS_DOS_WIN) || defined (_SICL_WIN32)
  670.  
  671. /* Version Information */
  672. int SICLAPI iversion(int _far *siclversion,int _far *implversion);
  673. int SICLAPI idrvrversion(INST id,int _far *specversion,int _far *implversion);
  674.  
  675. /* Open/Close */
  676. INST SICLAPI iopen(char _far *addr);
  677. int SICLAPI iclose(INST id);
  678. INST SICLAPI igetintfsess(INST id);
  679.  
  680. /* Write/Read */
  681. int SICLAPI iwrite (
  682.    INST id,
  683.    char _far *buf,
  684.    unsigned long datalen,
  685.    int endi,
  686.    unsigned long _far *actual
  687. );
  688. int SICLAPI iread (
  689.    INST id,
  690.    char _far *buf,
  691.    unsigned long bufsize,
  692.    int _far *reason,
  693.    unsigned long _far *actual
  694. );
  695. int SICLAPI itermchr(INST id,int tchr);
  696. int SICLAPI igettermchr(INST id,int _far *tchr);
  697.  
  698. /* Formatted I/O */
  699. int SICLAPIV iprintf (INST id, const char _far *fmt, ...);
  700. int SICLAPIV ivprintf (INST id, const char _far *fmt, va_list ap);
  701. int SICLAPIV isprintf (char _far *user_buf, const char _far *fmt, ...);
  702. int SICLAPIV isvprintf (char _far *user_buf, const char _far *fmt, va_list ap);
  703.  
  704. int SICLAPIV iscanf (INST id, const char _far *fmt, ...);
  705. int SICLAPIV ivscanf (INST id, const char _far *fmt, va_list ap);
  706. int SICLAPIV isscanf (char _far *user_buf, const char _far *fmt, ...);
  707. int SICLAPIV isvscanf (char _far *user_buf, const char _far *fmt, va_list ap);
  708.  
  709. int SICLAPIV ipromptf (
  710.    INST id, 
  711.    const char _far *writefmt, 
  712.    const char _far *readfmt, 
  713.    ...
  714. );
  715. int SICLAPIV ivpromptf (
  716.    INST id, 
  717.    const char _far *writefmt, 
  718.    const char _far *readfmt, 
  719.    va_list ap
  720. );
  721.  
  722. int SICLAPI ifwrite (
  723.    INST id, 
  724.    char _far *buf, 
  725.    unsigned long datalen, 
  726.    int end, 
  727.    unsigned long _far *actualcnt
  728. );
  729. int SICLAPI ifread (
  730.    INST id, 
  731.    char _far *buf, 
  732.    unsigned long bufsize, 
  733.    int _far *reason, 
  734.    unsigned long _far *actualcnt
  735. );
  736.  
  737. int SICLAPI iflush (INST id, int mask);
  738. int SICLAPI isetbuf (INST id, int mask, int size);
  739. int SICLAPI isetubuf (INST id, int mask, int size, char _far *buf);
  740.  
  741. /* Device/Interface Control */
  742. int SICLAPI iclear(INST id);
  743. int SICLAPI iabort(INST id);
  744. int SICLAPI ilocal (INST id);
  745. int SICLAPI iremote (INST id);
  746. int SICLAPI ireadstb(INST id,unsigned char _far *stb);
  747. int SICLAPI itrigger(INST id);
  748. int SICLAPI ixtrig(INST id,unsigned long which);
  749. int SICLAPI ihint(INST id,int hint);
  750.  
  751. /* Commander Sessions */
  752. int SICLAPI isetstb(INST id, unsigned char stb);
  753.  
  754. /* Service Requests */
  755. typedef void (SICLCALLBACK *srqhandler_t)(INST);
  756. int SICLAPI ionsrq(INST id,srqhandler_t shdlr);
  757. int SICLAPI igetonsrq(INST id, srqhandler_t _far *shdlr);
  758.  
  759. /* Interrupts */
  760. typedef void (SICLCALLBACK *intrhandler_t)(INST,long,long);
  761. int SICLAPI ionintr(INST id,intrhandler_t ihdlr);
  762. int SICLAPI igetonintr(INST id, intrhandler_t _far * ihdlr);
  763. int SICLAPI isetintr(INST id,int intnum,long secval);
  764.  
  765. /* Asynchronous Events Control */
  766. int SICLAPI iintroff(void);
  767. int SICLAPI iintron(void);
  768. int SICLAPI iwaithdlr(long timeout);
  769.  
  770. /* Locking */
  771. int SICLAPI ilock(INST id);
  772. int SICLAPI iunlock(INST id);
  773. int SICLAPI isetlockwait(INST id,int flag);
  774. int SICLAPI igetlockwait(INST id,int _far *flag);
  775.  
  776. /* Timeouts */
  777. int SICLAPI itimeout(INST id,long tval);
  778. int SICLAPI igettimeout(INST id,long _far *tval);
  779.  
  780. /* Misc. Functions */
  781. int SICLAPI igetaddr(INST id,char _far * _far *addr);
  782. int SICLAPI isetdata(INST id,void _far *data);
  783. int SICLAPI igetdata(INST id,void _far * _far *data);
  784. int SICLAPI igetintftype(INST id,int _far *pdata);
  785. int SICLAPI igetsesstype(INST id,int _far *pdata);
  786. int SICLAPI igetdevaddr(INST id,int _far *prim, int _far *sec);
  787. int SICLAPI igetlu(INST id, int _far *lu);
  788. int SICLAPI ibeswap(char _far *addr,unsigned long length,int datasize);
  789. int SICLAPI ileswap(char _far *addr,unsigned long length,int datasize);
  790. int SICLAPI iswap(char _far *addr,unsigned long length,int datasize);
  791. int SICLAPI igetlulist(int _far * _far *list);
  792. int SICLAPI igetluinfo(int lu,struct lu_info _far *result);
  793. int SICLAPI igetgatewaytype(INST id,int _far *pdata);
  794. void SICLAPI siclExplicitlyLoaded();
  795. void SICLAPI ionexitclose();
  796.  
  797. /* Error Handling */
  798. typedef void (SICLCALLBACK *errorproc_t)(INST,int);
  799. int SICLAPI ionerror(errorproc_t);
  800. int SICLAPI igetonerror(errorproc_t _far *);
  801. void SICLCALLBACK I_ERROR_EXIT(INST,int);
  802. void SICLCALLBACK I_ERROR_NO_EXIT(INST,int);
  803. int SICLAPI igeterrno (void);
  804. char _far * SICLAPI igeterrstr (int);
  805. void SICLAPI icauseerr (INST id, int errcode, int flag);
  806.  
  807. /* RS-232 specific functions */
  808. int SICLAPI iserialmclctrl (INST id, int sline, int state);
  809. int SICLAPI iserialmclstat (INST id, int sline, int _far *state);
  810. int SICLAPI iserialctrl (INST id, int request, unsigned long setting);
  811. int SICLAPI iserialstat (INST id, int request, unsigned long _far *result);
  812. int SICLAPI iserialbreak (INST id);
  813.  
  814. /* VXI Specific functions */
  815.    int SICLAPI ivxibusstatus(INST id,int request,unsigned long _far *result);
  816.    int SICLAPI ivxiwaitnormop(INST id);
  817.    int SICLAPI ivxitrigon(INST id,unsigned long which);
  818.    int SICLAPI ivxitrigoff(INST id,unsigned long which);
  819.    int SICLAPI ivxitrigroute(INST id,unsigned long in_which,unsigned long out_which);
  820.    int SICLAPI ivxigettrigroute(INST id,unsigned long which,unsigned long _far *route);
  821.    int SICLAPI ivxiws(INST id,unsigned short wscmd,unsigned short _far *wsresp,unsigned short _far *rpe);
  822.    int SICLAPI ivxiservants(INST id,int maxnum,int _far *list);
  823.    int SICLAPI ivxirminfo(INST id,int laddr, struct vxiinfo _far *info);
  824.  
  825. #if defined(_MS_DOS_WIN) || defined(_SICL_WIN32)
  826.    int  SICLAPI igetvberrbase (short *);
  827.    int  SICLAPI isetvberrbase (short);
  828.    void SICLAPI ibpoke(unsigned volatile char _far *addr, unsigned char value);
  829.    void SICLAPI iwpoke(unsigned volatile short _far *addr,unsigned short value);
  830.    void SICLAPI ilpoke(unsigned volatile long _far *addr, unsigned long value);
  831.    unsigned char SICLAPI ibpeek(unsigned volatile char _far *addr);
  832.    unsigned short SICLAPI iwpeek(unsigned volatile short _far *addr);
  833.    unsigned long SICLAPI ilpeek(unsigned volatile long _far *addr);
  834. #endif
  835.  
  836. /* new map/peek/poke/move routines */
  837.    unsigned long SICLAPI imapx(INST id, int mapspace, unsigned int pagestart, unsigned int pagecnt);
  838.    int SICLAPI iunmapx(INST id, unsigned long handle, int mapspace, unsigned int pagestart, unsigned int pagecnt);
  839.    int SICLAPI iderefptr(INST id, unsigned long handle, unsigned char *value);
  840.    int SICLAPI ipeekx8( INST id, unsigned long handle, unsigned long offset, unsigned char  *value);
  841.    int SICLAPI ipeekx16(INST id, unsigned long handle, unsigned long offset, unsigned short *value);
  842.    int SICLAPI ipeekx32(INST id, unsigned long handle, unsigned long offset, unsigned long  *value);
  843.    int SICLAPI ipokex8( INST id, unsigned long handle, unsigned long offset, unsigned char  value);
  844.    int SICLAPI ipokex16(INST id, unsigned long handle, unsigned long offset, unsigned short value);
  845.    int SICLAPI ipokex32(INST id, unsigned long handle, unsigned long offset, unsigned long  value);
  846. #if defined (_SICL_VXI_D64)
  847.    int SICLAPI ipeekx64(INST id, unsigned long handle, unsigned long offset, unsigned __int64 *value);
  848.    int SICLAPI ipokex64(INST id, unsigned long handle, unsigned long offset, unsigned __int64 value);
  849. #endif
  850.    int SICLAPI iblockmovex(INST id,
  851.                       unsigned long src_handle,
  852.                       unsigned long src_offset,
  853.                       int           src_width,
  854.                       int           src_increment,
  855.                       unsigned long dest_handle,
  856.                       unsigned long dest_offset,
  857.                       int           dest_width,
  858.                       int           dest_increment,
  859.                       unsigned long cnt,
  860.                       int           swap
  861.                      );
  862.    int SICLAPI ivximacro(INST id, ivximacroelem macro[], int size);
  863.  
  864. /* GP-IB Specific functions */
  865.    int SICLAPI igpibbusstatus (INST id, int request, int _far *result);
  866.    int SICLAPI igpibppoll (INST id, unsigned int _far *result);
  867.    int SICLAPI igpibppollconfig (INST id, int cval);
  868.    int SICLAPI igpibppollresp (INST id, int sval);
  869.    int SICLAPI igpibpassctl (INST id, int busaddr);
  870.    int SICLAPI igpibrenctl (INST id, int ren);
  871.    int SICLAPI igpibatnctl (INST id, int atnval);
  872.    int SICLAPI igpibsendcmd (INST id, char _far *buf, int length);
  873.    int SICLAPI igpibllo (INST id);
  874.    int SICLAPI igpibbusaddr (INST id, int busaddr);
  875.    int SICLAPI igpibgett1delay (INST id, int _far *delay);
  876.    int SICLAPI igpibsett1delay (INST id, int delay);
  877.    int SICLAPI igpibpulseifc (INST id);
  878.  
  879. /* GPIO Specific functions */
  880. int SICLAPI igpioctrl(INST id,int request,unsigned long setting);
  881. int SICLAPI igpiostat(INST id,int request,unsigned long _far *result);
  882. int SICLAPI igpiosetwidth(INST id,int width);
  883. int SICLAPI igpiogetwidth(INST id,int _far *width);
  884.  
  885. /* MSIB Specific functions */
  886. int SICLAPI imsibeventmask(INST id,unsigned char mask);
  887. int SICLAPI imsibcmd(INST id,unsigned int cmd,int row,int column,
  888.            char _far *resp,unsigned long bufsize,
  889.            unsigned long _far *actualcnt);
  890. int SICLAPI imsibseterror(INST id,int row,int column,
  891.                 char _far *errtext,int errtype,int _far *msiberr);
  892. int SICLAPI imsibclearerror(INST id,int msiberr);
  893. int SICLAPI imsibinfo(INST id,int row,int column,
  894.             struct msibinfo _far *info);
  895. int SICLAPI imsibmodule(INST id,int row,int column,int _far *result);
  896. int SICLAPI imsibsetstb(INST id,unsigned char stb);
  897.  
  898. /* LAN Specific functions */
  899. int SICLAPI ilantimeout(INST id,long tval);
  900. int SICLAPI ilangettimeout(INST id,long _far *tval);
  901.  
  902. /* Map routines */
  903. char _far * SICLAPI imap(INST id,int mapspace,unsigned int pagestart,unsigned int pagecnt,char _far *suggested);
  904. int SICLAPI iunmap(INST id,char _far *addr,int mapspace,unsigned int pagestart,unsigned int pagecnt);
  905. int SICLAPI imapinfo(INST id,int mapspace,int _far *numwindows,int _far *winsize);
  906.  
  907. /* block copy and fifo routines */
  908. int SICLAPI ibblockcopy(INST id, unsigned char _far *src, unsigned char _far *dest,
  909.                 unsigned long cnt);
  910. int SICLAPI iwblockcopy(INST id, unsigned short _far *src, unsigned short _far *dest,
  911.                 unsigned long cnt, int swap);
  912. int SICLAPI ilblockcopy(INST id, unsigned long _far *src, unsigned long _far *dest,
  913.                 unsigned long cnt, int swap);
  914. int SICLAPI ibpushfifo(INST id, unsigned char _far *src, unsigned char _far *fifo,
  915.                unsigned long cnt);
  916. int SICLAPI iwpushfifo(INST id, unsigned short _far *src,unsigned short _far *fifo,
  917.                unsigned long cnt, int swap);
  918. int SICLAPI ilpushfifo(INST id, unsigned long _far *src, unsigned long _far *fifo,
  919.                unsigned long cnt, int swap);
  920. int SICLAPI ibpopfifo(INST id, unsigned char _far *fifo, unsigned char _far *dest,
  921.               unsigned long cnt);
  922. int SICLAPI iwpopfifo(INST id, unsigned short _far *fifo, unsigned short _far *dest,
  923.               unsigned long cnt, int swap);
  924. int SICLAPI ilpopfifo(INST id, unsigned long _far *fifo, unsigned long _far *dest,
  925.               unsigned long cnt, int swap);
  926. int SICLAPI icmd(INST,long,int,int,void _far *); /* Send non-standard commands to driver */
  927. /* These are not standard SICL routines */
  928. #if !defined(STD_SICL)
  929.    int SICLAPI itrace(int level); /* Turn on tracing */
  930.    int SICLAPI isetcscpidata(INST id, void _far *data);
  931.    int SICLAPI igetcscpidata(INST id, void _far * _far *data);
  932.    int SICLAPI isetsig(int sig_val);
  933.    int SICLAPI igetsig(int _far *sig_val);
  934.    int SICLAPI _export _siclcleanup(void); /* process cleanup for Win 3.1*/
  935.    int SICLAPI _export _setsiclyield(int); /* yield option for Win 3.1 */
  936.    int SICLAPI igetblockmode( INST id, short *mode );
  937. #endif
  938.  
  939. #else /* __STDC__ || __cplusplus || _MS_DOS_WIN || _SICL_WIN32 */
  940.    /* Old C (ie. not ANSI C or C++) */
  941.    /* Version */
  942.    int iversion();
  943.    int idrvrversion();
  944.  
  945.    /* Open/Close */
  946.    INST iopen();
  947.    int iclose();
  948.    INST igetintfsess();
  949.    
  950.    /* Read/Write */
  951.    int iwrite();
  952.    int iread();
  953.    int itermchr();
  954.    int igettermchr();
  955.  
  956. /* Formatted I/O */
  957.    int iprintf ();
  958.    int ivprintf ();
  959.    int isprintf ();
  960.    int isvprintf ();
  961.  
  962.    int iscanf ();
  963.    int ivscanf ();
  964.    int isscanf ();
  965.    int isvscanf ();
  966.  
  967.    int ipromptf ();
  968.    int ivpromptf ();
  969.  
  970.    int ifwrite ();
  971.    int ifread ();
  972.  
  973.    int iflush ();
  974.    int isetbuf ();
  975.    int isetubuf ();
  976.    
  977.    /* Device/Interface Control */
  978.    int iclear();
  979.    int iabort();
  980.    int ilocal ();
  981.    int iremote ();
  982.    int ireadstb();
  983.    int itrigger();
  984.    int ixtrig();
  985.    int ihint();
  986.    
  987.    /* Commander Sessions */
  988.    int isetstb();
  989.  
  990.    /* Service Requests */
  991.    int ionsrq();
  992.    int igetonsrq();
  993.    
  994.    /* Interrupts */
  995.    int ionintr();
  996.    int igetonintr();
  997.    int isetintr();
  998.    
  999.    /* Asynchronous Events Control */
  1000.    int iintroff();
  1001.    int iintron();
  1002.    int iwaithdlr();
  1003.    
  1004.    /* Locking */
  1005.    int ilock();
  1006.    int iunlock();
  1007.    int isetlockwait();
  1008.    int igetlockwait();
  1009.    
  1010.    /* Timeouts */
  1011.    int itimeout();
  1012.    int igettimeout();
  1013.    
  1014.    /* Misc. Functions */
  1015.    int igetaddr();
  1016.    int isetdata();
  1017.    int igetdata();
  1018.    int igetintftype();
  1019.    int igetsesstype();
  1020.    int igetdevaddr();
  1021.    int igetlu();
  1022.    int ibeswap();
  1023.    int ileswap();
  1024.    int iswap();
  1025.    int igetlulist();
  1026.    int igetluinfo();
  1027.    int igetgatewaytype();
  1028.    
  1029.    /* Error Handling */
  1030.    int ionerror();
  1031.    int igetonerror();
  1032.    void I_ERROR_EXIT();
  1033.    void I_ERROR_NO_EXIT();
  1034.    int igeterrno ();
  1035.    char _far *igeterrstr ();
  1036.    void icauseerr ();
  1037.  
  1038. /* RS-232 specific functions */
  1039.    int iserialmclctrl ();
  1040.    int iserialmclstat ();
  1041.    int iserialctrl ();
  1042.    int iserialstat ();
  1043.    int iserialbreak ();
  1044.  
  1045. /* VXI Specific functions */
  1046.    int ivxibusstatus();
  1047.    int ivxiwaitnormop();
  1048.    int ivxitrigon();
  1049.    int ivxitrigoff();
  1050.    int ivxitrigroute();
  1051.    int ivxigettrigroute();
  1052.    int ivxiws();
  1053.    int ivxiservants();
  1054.    int ivxirminfo();
  1055.  
  1056. #if defined(_MS_DOS_WIN) || defined(_SICL_WIN32)
  1057.    void ibpoke();
  1058.    void iwpoke();
  1059.    void ilpoke();
  1060.    unsigned char ibpeek();
  1061.    unsigned short iwpeek();
  1062.    unsigned long ilpeek();
  1063. #endif 
  1064.  
  1065. /* GP-IB Specific functions */
  1066.    int igpibbusstatus();
  1067.    int igpibppoll();
  1068.    int igpibppollconfig();
  1069.    int igpibppollresp();
  1070.    int igpibpassctl();
  1071.    int igpibrenctl();
  1072.    int igpibatnctl();
  1073.    int igpibsendcmd();
  1074.    int igpibbusaddr ();
  1075.    int igpibllo ();
  1076.    int igpibpulseifc ();
  1077.    
  1078. /* GPIO Specific functions */
  1079.    int igpioctrl();
  1080.    int igpiostat();
  1081.    int igpiosetwidth();
  1082.    int igpiogetwidth();
  1083.  
  1084. /* MSIB Specific functions */
  1085.    int imsibeventmask();
  1086.    int imsibcmd();
  1087.    int imsibseterror();
  1088.    int imsibclearerror();
  1089.    int imsibinfo();
  1090.    int imsibmodule();
  1091.    int imsibsetstb();
  1092.  
  1093. /* LAN Specific functions */
  1094.    int ilantimeout();
  1095.    int ilangettimeout();
  1096.  
  1097.    /* Map routines */
  1098.    char _far *imap();
  1099.    int iunmap();
  1100.    int imapinfo();
  1101.    int ibblockcopy();
  1102.    int iwblockcopy();
  1103.    int ilblockcopy();
  1104.    int ibpushfifo();
  1105.    int iwpushfifo();
  1106.    int ilpushfifo();
  1107.    int ibpopfifo();
  1108.    int iwpopfifo();
  1109.    int ilpopfifo();
  1110.    
  1111.    int icmd();
  1112.  
  1113.    /* These are not standard SICL routines */
  1114. #if !defined(STD_SICL)
  1115.    int itrace();
  1116.    int isetcscpidata();
  1117.    int igetcscpidata();
  1118.    int isetsig();
  1119.    int igetsig();
  1120.    int igetblockmode();
  1121. #endif
  1122.    
  1123. #endif /* __STDC__ || __cplusplus || _MS_DOS_WIN || _SICL_WIN32 */
  1124.  
  1125. #endif /* ! SICL_NOPROTO */
  1126.  
  1127. /* Peek/Poke Macros */
  1128.  
  1129. #if !defined(_MS_DOS_WIN) && !defined(_SICL_WIN32)
  1130. /* Lynx/Fantasia VXI interface needs a FIFO check before the dereference on
  1131.  * VXI writes -- BJS
  1132.  */
  1133. #if defined(_SICL_LYNX_FA)
  1134.  
  1135. /* This global (defined and initialized by SICL) is a pointer to the Universe
  1136.  * MISC_STAT register.
  1137.  */
  1138. extern volatile unsigned long *sicl_universe_misc_stat;
  1139.  
  1140. /* UNIVERSE_FIFO_WAIT waits until the Universe write FIFO is empty */
  1141. #define UNIVERSE_FIFO_WAIT \
  1142.    do { \
  1143.    } while ((*sicl_universe_misc_stat & 0x00040000L) == 0)
  1144.  
  1145. /* In the i*poke macros below, don't even consider removing the outer
  1146.  * "do { } while (0)" structure.  This "trick" makes these macros into a
  1147.  * single incomplete statement, so they behave like the old i*poke macros.
  1148.  */
  1149. #define ibpoke(addr,val) \
  1150. do { \
  1151.    UNIVERSE_FIFO_WAIT; \
  1152.    (*(unsigned volatile char *)(addr)) = ((unsigned char)(val)); \
  1153. } while (0)
  1154.  
  1155. #define iwpoke(addr,val) \
  1156. do { \
  1157.    UNIVERSE_FIFO_WAIT; \
  1158.    (*(unsigned volatile short *)(addr)) = ((unsigned short)(val)); \
  1159. } while (0)
  1160.  
  1161. #define ilpoke(addr,val) \
  1162. do { \
  1163.    UNIVERSE_FIFO_WAIT; \
  1164.    (*(unsigned volatile long *)(addr)) = ((unsigned long)(val)); \
  1165. } while (0)
  1166.  
  1167. #define ibpeek(addr) *((unsigned volatile char *)(addr))
  1168. #define iwpeek(addr) *((unsigned volatile short *)(addr))
  1169. #define ilpeek(addr) *((unsigned volatile long *)(addr))
  1170.  
  1171. #else /* ! Lynx/Fantasia */
  1172. #define ibpoke(addr,val) (*(unsigned volatile char _far *)(addr))=((unsigned char)(val))
  1173. #define iwpoke(addr,val) (*(unsigned volatile short _far *)(addr))=((unsigned short)(val))
  1174. #define ilpoke(addr,val) (*(unsigned volatile long _far *)(addr))=((unsigned long)(val))
  1175. #define ibpeek(addr) *((unsigned volatile char _far *)(addr))
  1176. #define iwpeek(addr) *((unsigned volatile short _far *)(addr))
  1177. #define ilpeek(addr) *((unsigned volatile long _far *)(addr))
  1178. #endif /* ! Lynx/Fantasia */
  1179. #endif /* ! _MS_DOS_WIN */
  1180.  
  1181. /* define VXI word serial commands for ivxiws() */
  1182. #if defined(I_SICL_VXI) && !defined(STD_SICL)
  1183. /* Misc. Word Serial Defines */
  1184. #define  WS_BNO_TOP_LVL    0x0100
  1185.  
  1186. /* Word Serial Commands */
  1187. #define  WS_CMD_ANO     0xc8ff
  1188. #define     WS_MASK_ANO    0xffff
  1189. #define  WS_CMD_AHL     0xa900
  1190. #define     WS_MASK_AHL    0xff00
  1191. #define  WS_CMD_AIL     0xaa00
  1192. #define     WS_MASK_AIL    0xff00
  1193. #define  WS_CMD_AMC     0xa800
  1194. #define     WS_MASK_AMC    0xff00
  1195. #define  WS_CMD_BNO     0xfcff
  1196. #define     WS_MASK_BNO    0xfeff
  1197. #define  WS_CMD_BA      0xbc00
  1198. #define  WS_CMD_BA_END     0xbd00
  1199. #define     WS_MASK_BA     0xfe00
  1200. #define  WS_CMD_BR      0xdeff
  1201. #define     WS_MASK_BR     0xffff
  1202. #define  WS_CMD_CLR     0xffff
  1203. #define     WS_MASK_CLR    0xffff
  1204. #define  WS_CMD_CL      0xefff
  1205. #define     WS_MASK_CL     0xffff
  1206. #define  WS_CMD_CE      0xaf00
  1207. #define     WS_MASK_CE     0xff00
  1208. #define  WS_CMD_ENO     0xc9ff
  1209. #define     WS_MASK_ENO    0xffff
  1210. #define  WS_CMD_RPE     0xcdff
  1211. #define     WS_MASK_RPE    0xffff
  1212. #define  WS_CMD_GD      0xbf00
  1213. #define     WS_MASK_GD     0xff00
  1214. #define  WS_CMD_IC      0xbe00
  1215. #define     WS_MASK_IC     0xff00
  1216. #define  WS_CMD_RHL     0x8c00
  1217. #define     WS_MASK_RHL    0xff00
  1218. #define  WS_CMD_RH      0xc7ff   
  1219. #define     WS_MASK_RH     0xffff
  1220. #define  WS_CMD_RIL     0x8d00
  1221. #define     WS_MASK_RIL    0xff00
  1222. #define  WS_CMD_RI      0xcaff
  1223. #define     WS_MASK_RI     0xffff
  1224. #define  WS_CMD_RMOD    0xccff
  1225. #define     WS_MASK_RMOD      0xffff
  1226. #define  WS_CMD_RP      0xdfff
  1227. #define     WS_MASK_RP     0xffff
  1228. #define  WS_CMD_RSTB    0xcfff
  1229. #define     WS_MASK_RSTB      0xffff
  1230. #define  WS_CMD_RSA     0xceff
  1231. #define     WS_MASK_RSA    0xffff
  1232. #define  WS_CMD_RD      0x8e00
  1233. #define     WS_MASK_RD     0xff00
  1234. #define  WS_CMD_CR      0x8f00
  1235. #define     WS_MASK_CR     0xff00
  1236. #define  WS_CMD_SL      0xeeff
  1237. #define     WS_MASK_SL     0xffff
  1238. #define  WS_CMD_SLMOD      0xae00
  1239. #define     WS_MASK_SLMOD     0xff00
  1240. #define  WS_CMD_SUMOD      0xad00
  1241. #define     WS_MASK_SUMOD     0xff00
  1242. #define  WS_CMD_TRIG    0xedff
  1243. #define     WS_MASK_TRIG      0xffff
  1244. #define  WS_CMD_USER    0x0000
  1245. #define     WS_MASK_USER      0x8000
  1246.  
  1247. #endif  /* VXI WS support */
  1248.  
  1249. /*
  1250.  * This is a collection of macros and entry points needed for
  1251.  * backwards compatability for SICL.  They are now a collection
  1252.  * of non-standard HPIB/GPIB macros.
  1253.  */
  1254. #if ! defined(STD_SICL)
  1255. #define I_SICL_HPIB        /* GP-IB ==> HP-IB */
  1256. #define I_INTF_HPIB  I_INTF_GPIB /* GP-IB ==> HP-IB */
  1257.  
  1258.  
  1259. #define I_INTR_HPIB_IFC       16
  1260. #define I_INTR_HPIB_PPOLLCONFIG     17
  1261. #define I_INTR_HPIB_REMLOC    18
  1262.  
  1263. #define I_HPIB_BUS_REM     I_GPIB_BUS_REM
  1264. #define I_HPIB_BUS_SRQ     I_GPIB_BUS_SRQ
  1265. #define I_HPIB_BUS_NDAC    I_GPIB_BUS_NDAC
  1266. #define I_HPIB_BUS_SYSCTLR I_GPIB_BUS_SYSCTLR
  1267. #define I_HPIB_BUS_ACTCTLR I_GPIB_BUS_ACTCTLR
  1268. #define I_HPIB_BUS_TALKER  I_GPIB_BUS_TALKER
  1269. #define I_HPIB_BUS_LISTENER   I_GPIB_BUS_LISTENER
  1270. #define I_HPIB_BUS_ADDR    I_GPIB_BUS_ADDR
  1271.  
  1272. #define ihpibbusstatus     igpibbusstatus
  1273. #define ihpibppoll      igpibppoll
  1274. #define ihpibppollconfig   igpibppollconfig
  1275. #define ihpibpassctl    igpibpassctl
  1276. #define ihpibrenctl     igpibrenctl
  1277. #define ihpibatnctl     igpibatnctl
  1278. #define ihpibsendcmd    igpibsendcmd
  1279. #endif
  1280.  
  1281. #if defined(__cplusplus)
  1282.    };
  1283. #endif
  1284.  
  1285. #endif /* SICL_H */
  1286.